{include file="User@Public:header"/}
<link rel="stylesheet" type="text/css" href="__CSS__/login.css">
<div class="container-lg centered mt60">
	<div class="col-xs-12 col-md-12 col-lg-10 col-lg-offset-1">
		<div class="panel-green panel-half">
			<div class="row">
				<div class="col-sm-12 col-md-6">
					<div class="panel-form p30 active">
						<div class="tac mt10">
							<h1 class="s36">
								用户登录
							</h1>
						</div>
						<div class="mt20">
							<form action="" method="post">
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">登录账号</span>
										<input class="form-control" id="username" placeholder="用户名/邮箱" name="username" type="text" />
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">登录密码</span>
										<input class="form-control" id="password" placeholder="密码" name="password" type="password" value="" />
									</div>
								</div>
								<div class="form-group">
									<div class="input-group">
										<span class="input-group-addon">验 证 码&nbsp;</span>
										<input class="form-control" id="verify" placeholder="验证码" name="verify" type="text" />
										<span class="input-group-addon input-group-image"><img class="verifyimg reloadverify" alt="点击切换" src="{:U('verify')}" style="cursor:pointer; height: 40px"></span>
									</div>
								</div>
								<div class="tar mt40 mb10">
									<a class="btn txt-link mr5" href="{:U('Public/forget')}">忘记密码？</a>
									<a class="btn btn-submit btn-lg" href="{:U('Public/register')}" >注册</a>
									<button class="btn btn-submit btn-lg" type="submit" >登录</button>
								</div>
							</form>
						</div>
					</div>
				</div>
				<div class="col-sm-12 col-md-6">
					<div class="p30">
						<h2 class="txt-green">
							第三方登录
						</h2>
						<hr />
						<div class="row mt20">
						{:hook('SyncLogin')}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function(){
	$("form").submit(function(){
		var self = $(this);
		$.post(self.attr("action"), self.serialize(), success, "json");
		return false;

		function success(data){
			if(data.status){
				window.location.href = data.url;
			} else {
				$.messager.show(data.info, {placement: 'center',type:'success'});
				//刷新验证码
				$(".reloadverify").click();
			}
		}
	});

	var verifyimg = $(".verifyimg").attr("src");
	$(".reloadverify").click(function(){
		if( verifyimg.indexOf('?')>0){
			$(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
		}else{
			$(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
		}
	});
});
</script>
{include file="User@Public:footer"/}
